package com.aijk.web.admin.controller.openapi;

import com.aijk.ehm.api.EhmCompanyApi;
import com.aijk.ehm.model.qo.EhmCompanyQo;
import com.aijk.web.admin.controller.openapi.entity.ApiEntity;
import com.aijk.web.admin.controller.openapi.entity.ApiResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.validation.Valid;

@Component
@Controller
public class EhmCompanyController extends ApiBaseController {

    private static final Logger logger = LoggerFactory.getLogger(EhmCompanyController.class);

    @Autowired
    private EhmCompanyApi companyApi;

    /**
     * 获取企业列表
     * @param companyQo
     * @return
     */
    @RequestMapping(path = "app/company/list", method = {RequestMethod.POST, RequestMethod.GET})
    @ResponseBody
    public Object companyList(@Valid EhmCompanyQo companyQo) {
        ApiResponse response = new ApiResponse();
        companyQo.setStatus((byte)10);
        response.setData( companyApi.list(companyQo));
        return response;
    }


}
